package com.sy.controller;

import com.sy.dto.Params;
import com.sy.dto.PartnerDto;
import com.sy.dto.PartnersDto;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class PartnerController extends BaseController {
    @RequestMapping(value = "partner/params", method = RequestMethod.POST)
    public List<PartnersDto> getDriSchoolListByParams(@RequestBody Params params){
        return partnerService.getPartnerListByParams(params);
    }
    @RequestMapping(value = "partner", method = RequestMethod.GET,params = {"type=showPartner"})
    public PartnerDto gePartnerById(Integer id){
        return partnerService.getPartnerDtoByPartnerId(id);
    }
    @RequestMapping(value = "partner", method = RequestMethod.POST)
    public Integer getPagesByParams(@RequestBody Params params){
        return partnerService.getCountByParams(params);
    }
}
